GUI Help > Create > createGadgetFromWindow

createGadgetFromWindow
int handle=createGadgetFromWindow(handle window)

Description:
Wraps an existing window created by another program into a gadget so that you can interact with it using the other gadget commands. For example, if you wanted to set the title of the main DBPro window, you would do this:

main=createGadgetFromWindow(mainWindow())
setGadgetText main,"New Title"


Return Value:
Handle to the new gadget

Parameters:
window Handle to the window which is to be wrapped as a gadget. This is *not* a gadget handle. Windows documentation refers to this kind of handle as an HWND.
Remarks:
It is faster to use one call to setGadget than seperate calls to resizeGadget and moveGadget.

See Also:


Example:
(Note: You will need to include the GUI constants file for this example to work)